<div id='banner' class='navbar navbar-inverse navbar-fixed-top' role='banner'>
	<div class='container'>
		<div class='navbar-header'>
			<button class='navbar-toggle' data-target='#navbar-collapse' data-toggle='collapse' type='button'>
				<span class='sr-only'>Toggle navigation</span>
				<span class='icon-bar'></span>
				<span class='icon-bar'></span>
				<span class='icon-bar'></span>
			</button>
			<a class='navbar-brand' href='${virtualPath}manage/index'>CPPT 产品平台</a>
		</div>
		<div id='navbar-collapse' class='collapse navbar-collapse'>
			<ul class='nav navbar-nav'>
				#foreach($!obj in $!menuView.records)
					<li#if(2 == $velocityCount) class='active'#end><a href='#page/${virtualPath}manage/welcome' onclick='sideNav("$!obj.ID", this)'>$!obj.MENU_NAME</a></li>
				#end
			</ul>
			<ul class='nav navbar-nav navbar-right'>
				<li class='dropdown active'>
					<a href='javascript:;' class='dropdown-toggle' data-toggle='dropdown'>配置 <b class='caret'></b></a>
					<ul class='dropdown-menu'>
						<li><a href='#page/${virtualPath}user/changePwd'>修改密码</a></li>
					</ul>
				</li>
				<li class='active'><a href='javascript:;' onclick="$('#logoutConfirmModal').modal()">退出</a></li>
			</ul>
			<form id='topSearchFrm' class='navbar-form navbar-right' role='search' data-olx-type='olx.form' onsubmit='return false;'>
				<div class='form-group'><input class='form-control' type='text' placeholder='搜索'></div>
				<button class='btn btn-default' type='submit'>
					<div class='glyphicon glyphicon-search'></div>
				</button>
			</form>
		</div>
	</div>
</div>
<div class='modal fade' id='logoutConfirmModal'>
	<div class='modal-dialog'>
		<div class='modal-content'>
			<div class='modal-header'>
				<button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button>
				<h4 class='modal-title'><b>警告</b></h4>
			</div>
			<div class='modal-body'>
				<p>你确认要离开吗？</p>
			</div>
			<div class='modal-footer'>
				<button type='button' class='btn btn-default' data-dismiss='modal'>关闭</button>
				<button type='button' class='btn btn-primary' id='logoutConfirmModal_btn_submit'>确认</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
$(function(){
	$('#logoutConfirmModal_btn_submit').click(function(){
		location.href = '${virtualPath}user/logout'
	});
});
function sideNav(menuId, self){
	$(self).parents().find('.active').removeClass();
	$(self).parent().addClass('active');
	$ .ajax({
		url: 'sideNav.do',
		type: 'GET',
		dataType: 'JSON',
		data: { pid: menuId }
	}).done(function (data) {
		var data = data.msg;
		if(!data.success) return;
		var _data = data.data;
		if(!_data) return;
		$('#sideNav').html(_data);
	});
}
</script>